home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase v5.5 / SAMPLES1.PAK / SEARCH.WFM < prev    next >
Text File  |  1995-07-18  |  3KB  |  102 lines

  1. *****************************************************************************
  2. *  PROGRAM:      Search.wfm
  3. *
  4. *  WRITTEN BY:   Borland Samples Group
  5. *
  6. *  DATE:         5/93
  7. *
  8. *  UPDATED:      6/95
  9. *
  10. *  REVISION:     $Revision:   1.36  $
  11. *
  12. *  VERSION:      Visual dBASE
  13. *
  14. *  DESCRIPTION:  This form executes a simple search.  It will accept a value
  15. *                and search for it using the current index.  It allows the
  16. *                calling program to handle the results.  The entered value
  17. *                is attached to the OkButton, so the calling program can
  18. *                search for it in whatever way it needs.
  19. *
  20. *  PARAMETERS:   None
  21. *
  22. *  CALLS:        Buttons.cc         (Custom Controls file)
  23. *
  24. *  USAGE:        DO Search.wfm
  25. *                or
  26. *                (this is how Search is called from Orders.mnu and Customer.mnu)
  27. *                set procedure to Search.wfm additive
  28. *                local f
  29. *                f = new SearchForm()
  30. *                f.mdi = .F.       && modal forms cannot be mdi
  31. *                selected = f.ReadModal()
  32. *                seek f.value
  33. *
  34. *******************************************************************************
  35. #include <Messdlg.h>
  36. set ldCheck off
  37. ** END HEADER -- do not remove this line*
  38. * Generated on 06/15/95
  39. *
  40. parameter bModal
  41. local f
  42. f = new SEARCHFORM()
  43. if (bModal)
  44.    f.mdi = .F. && ensure not MDI
  45.    f.ReadModal()
  46. else
  47.    f.Open()
  48. endif
  49. CLASS SEARCHFORM OF SearchFormClass From "SAMPLE.CFM"
  50.    this.Left = 33.333
  51.    this.Top = 4
  52.    this.Height = 4.6875
  53.    this.Width = 36.833
  54.    this.OnOpen = CLASS::FORM_ONOPEN
  55.    this.OnClose = CLASS::FORM_ONCLOSE
  56.    this.OnSelection = CLASS::FORM_ONSELECTION
  57.  
  58.  
  59.    procedure Form_OnOpen
  60.    ****************************************************************************
  61.    set procedure to &_dbwinhome.samples\Sampproc.prg additive
  62.                                     && if Search was called from customer/
  63.    if type("this.keyName") <> "U"   && orders with the keyName property assigned
  64.       this.text = FormatStr("Search -- %1", this.keyName)
  65.       this.searchEntry.picture = this.formatting
  66.    endif
  67.    this.searchEntry.SetFocus()
  68.  
  69.  
  70.    ****************************************************************************
  71.  
  72.    procedure Form_OnClose
  73.    ****************************************************************************
  74.  
  75.    close procedure &_dbwinhome.samples\Buttons.cc,;
  76.        &_dbwinhome.samples\Sampproc.prg
  77.  
  78.  
  79.    ****************************************************************************
  80.  
  81.    procedure Form_OnSelection(controlId)
  82.  
  83.    * If value was specified, save it and close form.
  84.    ****************************************************************************
  85.  
  86.    if controlId <> 0   && If Cancel wasn't selected
  87.       form.value = form.searchEntry.value
  88.    endif
  89.    form.Close()
  90.  
  91.  
  92. ENDCLASS
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.